<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
		<link href="css/text.css" type="text/css" rel="stylesheet" />
		<link href="css/add.css" type="text/css" rel="stylesheet" />
		<script type="text/javascript" src="js/jquery-3.3.1.min.js" ></script>
		<script>
			setSize();
       		addEventListener('resize',setSize);
       		function setSize() {
            	document.documentElement.style.fontSize = document.documentElement.clientWidth/750*100+'px';
            }
       		var thisURL = document.URL;
			var getval =thisURL.split('?')[1];
			var showVal= getval.split("=")[1]; 
       		var ip;
			$(function(){
				var configJson='js/confing.json'
			$.getJSON(configJson,function(data){
				ip=data.urlip;
				$.ajax({
					type: "get",
					url: ip+"/user/type",
					data:{
						
					},
					dataType: "json",
					xhrFields: {withCredentials: true},
					crossDomain:true,
					success: function(res) {
						if(res.code==0)
						{	
							$("#exit").html("退出")
						}else{
							window.location.href="login.html"
						}
					},
					async:false
				});
				getlist()
			});
			})
			function exit(){
					$.ajax({
						type:"get",
						url:ip+"/logout",
						data:{},
						async:true,
						dataType: "json",
						xhrFields: {withCredentials: true},
      					crossDomain:true,
      					success:function(res)
      					{
      						if(!res.code){
      							window.location.href="login.html"
      						}
      					}
      			});
			}
			var total;
			var nextid=0;
			function getlist(studi){
       			$.ajax({
						type:"get",
						url:ip+"/client/surveyName",
						data:{
							
						},
						async:true,
						dataType: "json",
						xhrFields: {withCredentials: true},
      					crossDomain:true,
      					success:function(res)
      					{
      						if(!res.code){
      								total=res.data.total;
      								if(total){
      								$("#next_ques").html("继续填写问卷")
      								nextid=res.data.survey[0].id;
      								}else{
      									
      								$("#massageh").html("您当前的问卷已全部提交，感谢您的参与")
      								$("#next_ques").html("返回首页")
      								}
      						}
      					}
      			});
       		}
			function next_ques(){
				if(total){
				window.location.href="from.html?id="+nextid
				}else{
					window.location.href="list.html"
				}
			}
		</script>
	</head>
	<body style="width: 100% ;height: 50%; background:rgb(243,243,243);">
		<div style="font-size: .3rem;background: #bfeaef;line-height: .6rem;"><a href="list.html" style="margin: 0 0 0 3%;text-decoration: none;color: black; ">首页</a><a id="exit" href="JavaScript:exit();" style="font-size: .3rem;float: right;margin-right: .2rem;text-decoration: none;color: black;"> </a> </div>
		<div style="width: 80%;margin: 6% auto 0;background: white;padding: 3% 4%;">
			<div>
				<img src="img/success.png" style="width: 24%;margin: 7% 38% 5%;"/>
			</div>
			<div style="font-size: 0.4rem;text-align: center;margin: 0 0 10% 0;" id="massageh">
				您的问卷已经提交，感谢您的参与
			</div>
			
		</div>
		<div onclick="next_ques()" id="next_ques" style=" text-align: center;margin: 15% auto;width: 50%;background: #bfeaef;padding: 2% 2%;border-radius: .2rem;"></div>
		<div style="text-align: center;text-decoration: none;margin: 2% auto 10%;position: absolute;bottom: 1%;left: 25%;"><a style="text-decoration: none;font-size: .32rem;" href="https://wj.qq.com/s/2953793/5f86/">有问题点击这里告诉我们</a></div>
	
	</body>
</html>
